//
//  KFDOptionBar.h
//

#import <UIKit/UIKit.h>
#import "JTOptionBarConfiguration.h"

@class JTOptionBar;

typedef void(^JTOptionBarAction)(JTOptionBar* optionBar);

//---------------------------------------------------------------------
// JTOption
//---------------------------------------------------------------------
@interface JTOption : NSObject

@property (assign,nonatomic) NSInteger index;
@property (copy,nonatomic) id value;
@property (copy,nonatomic) NSString* title;
@property (copy,nonatomic) JTOptionBarAction action;

+(JTOption*)optionWithIndex:(NSInteger)index value:(id)value title:(NSString*)title action:(JTOptionBarAction)action;

@end
//---------------------------------------------------------------------

@interface JTOptionBar : UIView

@property (strong,nonatomic) JTOptionBarConfiguration* config;

@property (strong,readonly,nonatomic) NSMutableArray* options;
@property (strong,readonly,nonatomic) JTOption* selectedOption;

-(instancetype)initWithFrame:(CGRect)frame;
-(void)addOptionWithValue:(id)value title:(NSString*)title action:(JTOptionBarAction)action;

@end
